﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.DynamicData;
using System.Web.UI.WebControls;
using System.Collections.Specialized;

namespace FlexiCommerce.Web.UI.DynamicData
{
    public abstract class FilterTemplateUserControlBase : FieldTemplateUserControl, IWhereParametersProvider
    {
        /// <summary>
        /// Returns the Where Parameters created by the control
        /// </summary>
        /// <param name="dataSource"></param>
        /// <returns></returns>
        public abstract IEnumerable<Parameter> GetWhereParameters(IDynamicDataSource dataSource);

        /// <summary>
        /// Loads the control's values from the QueryString
        /// </summary>
        /// <param name="parameters"></param>
        public abstract void LoadQueryStringParameters(NameValueCollection parameters);

        /// <summary>
        /// Saves the control's values to the QueryString
        /// </summary>
        /// <returns></returns>
        public abstract NameValueCollection SaveQueryStringParameters();

        /// <summary>
        /// Clears the control's values;
        /// </summary>
        public abstract void Clear();
    }
}
